package com.dongdongshop.controller;

import com.dongdongshop.data.Result;
import com.dongdongshop.pojo.TbBrand;
import com.dongdongshop.service.BrandService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/test")
public class TestController {
    @DubboReference
    private BrandService brandService;

    @RequestMapping("/list")
    @ResponseBody
    public Result<TbBrand> list(){
        List<TbBrand> list = brandService.listBrands();

        return Result.OK().setData(list);
    }
}
